package com.example.anew.journey.mynewjourney.logic.setName;

import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.widget.Toast;

import com.example.anew.journey.mynewjourney.R;
import com.example.anew.journey.mynewjourney.base.BaseRegisteredSetActivity;
import com.example.anew.journey.mynewjourney.logic.setName.persenter.SetNamePersenter;
import com.example.anew.journey.mynewjourney.logic.setName.view.ISSetNameView;
import com.example.anew.journey.mynewjourney.logic.setPassword.SetPasswordActivity;

import butterknife.ButterKnife;
import cn.jesse.nativelogger.NLogger;

/**
 * 杭州惟君医疗科技有限公司12
 * Created by 20433 on 2018/3/5
 */

public class SetNameActivity extends BaseRegisteredSetActivity implements ISSetNameView {
    private SetNamePersenter setNamePersenter = new SetNamePersenter(this);
    private String phone;
    private String version_code;

    /**
     * @desc 点击下一步
     * */
    @Override
    protected void onClickBtNext() {
        setNamePersenter.btNextToSetPasswordActivity();

    }
    /**
     * @desc 点击Button的内容
     * */
    @Override
    protected String setNext() {
        return "下一步";
    }
    /**
     * @desc 点击Button的大小
     * */
    @Override
    protected int setNextSize() {
        return 16;
    }
    /**
     * @desc 点击Button的背景
     * */
    @Override
    protected Drawable setNextBg() {
        return getResources().getDrawable(R.drawable.registered_or_login_bt_get_verification_code);
    }
    /**
     * @desc 设置Title名称
     * */
    @Override
    protected String setTitleName() {
        return "设置名称";
    }
    /**
     * @desc 设置介绍内容
     * */
    @Override
    protected String setIntroduce() {
        return "希望大家怎么称呼你呀";
    }
    /**
     * @desc 获取输入的内容
     * */
    @Override
    protected void getEtContent(String trim) {
        set_et_content.setText(trim);
    }
    /**
     * @desc 设置Title名称颜色
     * */
    @Override
    protected int setTitleNameColor() {
        return 0xff333333;
    }
    /**
     * @desc 设置Title名称字体大小
     * */
    @Override
    protected int setTitleNameSize() {
        return 20;
    }
    /**
     * @desc 设置介绍内容颜色
     * */
    @Override
    protected int setIntroduceColor() {
        return 0xff999999;
    }
    /**
     * @desc 设置介绍内容字体大小
     * */
    @Override
    protected int setIntroduceSize() {
        return 14;
    }
    /**
     * @desc 点击返回按钮
     * */
    @Override
    protected void onClickReturn() {
        finish();
    }
    /**
     * @desc 设置EditText提示
     * */
    @Override
    protected String setEtContentHint() {
        return "请输入你的昵称";
    }
//    /**
//     * @desc 设置EditText输入类型
//     * */
//    @Override
//    protected int setEtContentInputType() {
//        return 0;
//    }
public String third_party_login_id;
    public String third_party_login_name;
    public String third_party_login_state;
    /**
     * @desc 初始化数据
     * */
    @Override
    protected void initDate() {
        Intent intent = getIntent();
        phone = intent.getStringExtra("phone");
        version_code = intent.getStringExtra("version_code");

        third_party_login_id = intent.getStringExtra("third_party_login_id");
        third_party_login_name = intent.getStringExtra("third_party_login_name");
        third_party_login_state = intent.getStringExtra("third_party_login_state");
        NLogger.e("TAG","=========state=====1018===="+third_party_login_id);
        NLogger.e("TAG","=========state=====1019===="+third_party_login_name);
        NLogger.e("TAG","=========state=====10020===="+third_party_login_state);
    }

    // 显示提示Toast信息
    @Override
    public void showToastInformation(String str) {
        Toast.makeText(SetNameActivity.this,str,Toast.LENGTH_SHORT).show();
    }
    // 获取输入的昵称
    @Override
    public String getInputNiName() {
        return set_et_content.getText().toString().trim();
    }
    // 设置输入的昵称
    @Override
    public void setInputNiName() {

    }
    // 跳转到设置密码页面
    @Override
    public void toSetPasswordActivity(String niname) {
        Intent intent =  new Intent(SetNameActivity.this,SetPasswordActivity.class);
        intent.putExtra("phone",phone);
        intent.putExtra("version_code",version_code);
        intent.putExtra("niname",niname);
        intent.putExtra("third_party_login_state",third_party_login_state);
        intent.putExtra("third_party_login_id",third_party_login_id);
        intent.putExtra("third_party_login_name",third_party_login_name);
        NLogger.e("TAG","=========state=====1015===="+third_party_login_id);
        NLogger.e("TAG","=========state=====1016===="+third_party_login_name);
        NLogger.e("TAG","=========state=====10017===="+third_party_login_state);
        intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
        startActivity(intent);
        finish();
    }
    /**
     * @desc Activity 销毁 释放资源
     */
    @Override
    protected void releaseResources() {
        ButterKnife.unbind(this);
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        NLogger.e("TAG","=========222=fgcj===========");
    }
}
